<template>
  <el-dialog title="提示" :visible.sync="myVisible" width="30%" @close="close">
    <span>是否确认删除？</span>
    <span slot="footer" class="dialog-footer">
      <el-button @click="close">取 消</el-button>
      <el-button type="primary" @click="onOk">确 定</el-button>
    </span>
  </el-dialog>
</template>
<script>
export default {
  props: {
    visible: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      myVisible: this.visible
    };
  },
  methods: {
    close() {
      this.$emit("close", false);
    },
    onOk() {
      this.$emit("onOk");
    }
  },
  watch: {
    visible(newV, oldV) {
      this.myVisible = newV;
    }
  }
};
</script>
